<{include file = '../include/user_header.html'}>

<{foreach from = $threads item = $thread}>
<div class="card mb-4 thread" onclick="location.href='<{url('thread','index',$thread.tid,0,0,1)}>'">
    <div class="card-body">
        <h5 class="card-title">
			<{if $thread.top == 1}>
			<span class="badge badge-secondary">置顶</span>
			<{else if $thread.top == 2}>
			<span class="badge badge-dark">公告</span>
			<{/if}>
			
			<{if $thread.points}>
			<span class="badge badge-danger"><{number($thread.points)}></span>
			<{/if}>
			<{if time() - $thread.time <= 12 * 60 * 60}>
			<span class="badge badge-success">最新</span>
			<{/if}>
			<{if $thread.comments >= 200}>
			<span class="badge badge-danger">热门</span>
			<{/if}>
			<{if $thread.essence}>
			<span class="badge badge-warning text-light">精华</span>
			<{/if}>
			<{if $thread.lock}>
			<span class="badge badge-info">锁定</span>
			<{/if}>
            
            <span><{$thread.title}></span>
        </h5>
        <h6 class="card-subtitle mb-2 mt-2"><{$thread.user.username}></h6>
        <p class="card-text thread-content"><{$thread.content}></p>
        <p class="card-text">
            <small class="text-muted">
                <span>发表时间：<{timeFormat($thread.time)}></span>
                <span class="float-right">
                    浏览：<{$thread.views}>
                    点赞：<{$thread.praises}>
                    评论：<{$thread.comments}>
                </span>
            </small>
        </p>
    </div>
</div>
<{foreachelse}>
<p class="text-center text-muted mt-5 mb-5">空空如也～</p>
<{/foreach}>
<div>
	<{pagination($user.threads,30,$p_1,url('user','threads',$p_0,'{{page}}'))}>
</div>

<{include file = '../include/user_footer.html'}>